//
//  ViewController.m
//  03-UIGestureRecognzier
//
//  Created by 曹曹 on 16/7/18.
//  Copyright © 2016年 曹曹. All rights reserved.
//

#import "ViewController.h"
#import "LabelButton.h"
#import "ImageViewButton.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    //通过UILabel封装实现只显示文字的Button
    //通过UIImageView封装实现只显示图片的Button 以上两种方式, 要考虑到通用性。
    //使用自己封装的控件, 加入到前两天编写的登陆页中
    LabelButton *button = [[LabelButton alloc] initWithFrame:CGRectMake(0, 0, 200, 40)
                                                       title:@"hhhh"
                                             backgroundColor:[UIColor redColor]
                                                   textColor:[UIColor blueColor]
                                                      target:self
                                                      action:@selector(handleButton:)];
    [self.view addSubview:button];
    ImageViewButton *imageButton = [[ImageViewButton alloc] initWithFrame:CGRectMake(100, 100, 200, 40)
                                                          backgroundColor:[UIColor redColor]
                                                                    image:@"4.jpg" target:self
                                                                   action:@selector(handleImageButton:)];
    [self.view addSubview:imageButton];
}

- (void)handleButton:(UITapGestureRecognizer *)tap {
    NSLog(@"labelButton");
}
- (void)handleImageButton:(UITapGestureRecognizer *)tap {
    NSLog(@"imageViewButton");
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
